package com.san.metadata.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.san.metadata.domain.DataImportDTO;
import com.san.metadata.service.DataImportService;

/**
 * 数据导入调度线程
 * @author xiangyz
 *
 */
public class DataImportThread extends Thread{
	
	private static final Logger logger = LoggerFactory.getLogger(DataImportThread.class);
	
	
	private DataImportDTO dataImportDTO;
	
	private DataImportService dataImportService;
	
	public DataImportThread(DataImportService dataImportService,DataImportDTO dataImportDTO) {
		this.dataImportService = dataImportService;
		this.dataImportDTO = dataImportDTO;
	}
	
	@Override
	public void run() {
		try {
			dataImportService.doImport(dataImportDTO);
		} catch (Exception e) {
			logger.error("数据导入失败",e);
		}
	}

}
